package com.alivehex.physensor5;

import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;

import com.androidplot.series.XYSeries;

public class DynamicSeries  implements XYSeries {
	private DataSource datasource;
    private String title;

    public DynamicSeries(DataSource datasource, String title) {
        this.datasource = datasource;
        this.title = title;
    }
    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public int size() {
        return datasource.getItemCount();
    }

    @Override
    public Number getX(int index) {
        return datasource.getX(index);
    }

    @Override
    public Number getY(int index) {
        return datasource.getY(index);
    }
    
    public DataSource getDataSource() {
    	return datasource;
    }
}
